.contextual
  = icon_link_to :print, {:action => :letter, :format => :pdf}, {:target => '_blank'} if resource.is_a?(DebitInvoice)
  = contextual_link_to :copy
  = contextual_links_for

= boot_page_title

- bookings = Booking.by_reference(resource)
- accounts = bookings.accounts

.tabbable
  %ul.nav.nav-tabs
    %li.active= link_to t_model, '#tab-main', {:data => {:toggle => 'tab'}}
    %li= link_to t_title(:list, Attachment), '#tab-attachments', {:data => {:toggle => 'tab'}}
    %li= link_to t_title(:list, Stock), '#tab-stocks', {:data => {:toggle => 'tab'}} if Bookyt::Engine.engines.include?('bookyt_stock')
    - accounts.each do |account|
      %li= link_to account.to_s, "#tab-account-#{account.id}", {:data => {:toggle => 'tab'}}

.tab-content
  #tab-main.tab-pane.active= render "form"
  #tab-attachments.tab-pane= render 'show_attachments'
  #tab-stocks.tab-pane= render 'bookyt_stock/invoices/show' if Bookyt::Engine.engines.include?('bookyt_stock')
  - accounts.each do |account|
    %div.tab-pane{:id => "tab-account-#{account.id}"}= render 'direct_bookings/show', :reference => resource, :direct_account => account
